// 暴击奖池 相关接口
import request from "@/utils/request";

/**
 * getList
 * @desc 暴击奖池详情
 * @returns {AxiosPromise}
 */
export function getList() {
  return request({
    url: '/critical/gift',
    method: 'get'
  })
}


/**
 * giftModify
 * @desc 暴击礼物 新增/编辑
 * @param data { gift_id: 目标礼物id 必传, old_gift_id: 编辑的原礼物id }
 * @returns {AxiosPromise}
 */
export function giftModify(data) {
  return request({
    url: '/critical/gift',
    method: 'put',
    data
  })
}


/**
 * delGift
 * @desc 删除暴击礼物
 * @param gift_id 礼物id
 * @returns {AxiosPromise}
 */
export function delGift(gift_id) {
  return request({
    url: '/critical/gift',
    method: 'delete',
    data: { gift_id }
  })
}



// 暴击奖池规则列表
export function getRuleList() {
  return request({
    url: '/critical/rule',
    method: 'get'
  })
}



/**
 * editRule
 * @desc 暴击规则新增/编辑
 * @param open_level
 * @param max_hit_times
 * @returns { AxiosPromise }
 */
export function editRule({ open_level, max_hit_times }) {
  return request({
    url: '/critical/rule',
    method: 'put',
    data: { open_level, max_hit_times }
  })
}


/**
 * delRule
 * @desc 删除暴击规则配置
 * @param open_level
 * @returns {AxiosPromise}
 */
export function delRule(open_level) {
  return request({
    url: '/critical/rule',
    method: 'delete',
    data: { open_level }
  })
}






